home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / hello_ki.swf / scripts / DefineSprite_28 / frame_30 / DoAction.as
Encoding:
Text File  |  2011-03-26  |  2.5 KB  |  86 lines

  1. if(_parent.FirstCard == _parent.SecondCard)
  2. {
  3.    if(_parent.CurrentPairsCount == 11)
  4.    {
  5.       _parent.FinalTime = "YOUR TIME: " + _parent.Timer.time;
  6.       _parent.FinalFlips = "FLIP COUNT: " + _parent.CurrentFlipsCount;
  7.       _parent.FinalTimeNum = int(_parent.Timer.atime[2]) * 60 + int(_parent.Timer.atime[4]) + int(_parent.Timer.atime[6]) / 10;
  8.       _parent.FinalFlipsNum = _parent.CurrentFlipsCount;
  9.       if(_parent.UsePersonalBest)
  10.       {
  11.          _parent.UpdateCookies = false;
  12.          if(_parent.FinalTimeNum < _parent.CookieGameTime | _parent.CookieGameTime == 0)
  13.          {
  14.             _parent.PersonalBestTime = _parent.FinalTimeNum;
  15.             _parent.UpdateCookies = true;
  16.          }
  17.          else
  18.          {
  19.             _parent.PersonalBestTime = _parent.CookieGameTime;
  20.          }
  21.          if(_parent.FinalFlipsNum < _parent.CookieGameFlips | _parent.CookieGameFlips == 0)
  22.          {
  23.             _parent.PersonalBestFlips = _parent.FinalFlipsNum;
  24.             _parent.UpdateCookies = true;
  25.          }
  26.          else
  27.          {
  28.             _parent.PersonalBestFlips = _parent.CookieGameFlips;
  29.          }
  30.          if(_parent.UpdateCookies)
  31.          {
  32.             _parent.PersonalRecords.gotoAndPlay("SetCookies");
  33.          }
  34.       }
  35.       if(_parent.UseScoreboard)
  36.       {
  37.          _parent.GameOverPage = "GameComplete";
  38.          _parent.gotoAndPlay("GameOver");
  39.       }
  40.       else
  41.       {
  42.          _parent.GameOverPage = "CompleteNoScoreboard";
  43.          _parent.gotoAndPlay("GameOver");
  44.       }
  45.    }
  46.    else
  47.    {
  48.       tellTarget("_parent." + _parent.FirstCardName + ".CardMotion")
  49.       {
  50.          gotoAndStop("CardFadeOut");
  51.          play();
  52.       }
  53.       tellTarget("_parent." + _parent.SecondCardName + ".CardMotion")
  54.       {
  55.          gotoAndStop("CardFadeOut");
  56.          play();
  57.       }
  58.       _parent.matchedArray[_parent.FirstCard] = true;
  59.       var TempPairsCount = 0;
  60.       x = 1;
  61.       while(x < 13)
  62.       {
  63.          if(_parent.matchedArray[x])
  64.          {
  65.             TempPairsCount++;
  66.          }
  67.          x++;
  68.       }
  69.       _parent.CurrentPairsCount = TempPairsCount;
  70.       _parent.CurrentPairs = "PAIRS MATCHED: " + _parent.CurrentPairsCount;
  71.    }
  72. }
  73. else
  74. {
  75.    tellTarget("_parent." + _parent.FirstCardName + ".CardMotion")
  76.    {
  77.       gotoAndStop("SpinBack");
  78.       play();
  79.    }
  80.    tellTarget("_parent." + _parent.SecondCardName + ".CardMotion")
  81.    {
  82.       gotoAndStop("SpinBack");
  83.       play();
  84.    }
  85. }
  86.